feat: add bidirectional request/response protocol support#480
Merged
Conversation
Enable symmetric request/response handling between client and server. Complements the server-side changes in glsp-server-node. - Add optional `timeout` field to `RequestAction` - Update `requestUntil()` default to respect `action.timeout` - Stamp effective timeout onto action in `requestUntil()` so the receiving side can respect it - Use `request()` vs `requestUntil()` in `handleServerRequest` and `handleClientRequest` based on `action.timeout` presence - Fix `&&` vs `||` bug in requestId emptiness checks - Fix `RequestAction` import to resolve GLSP protocol type - Add async `handleServerRequest()` in `GLSPModelSource` with `RejectAction` error handling - Add `GetSelectionHandler` for server-initiated selection queries - Add `GetEditorContextAction` / `SetEditorContextAction` protocol types and handler in `EditorContextService` Relates to eclipse-glsp/glsp#607
Merged
2 tasks
tortmayr
requested changes
Apr 9, 2026
Contributor
tortmayr
left a comment
There was a problem hiding this comment.
Thanks Martin! Great new feature.
I did a first high-level review of the code and added some comments.
In addition, I quickly tested the client-server change in combination. From what I can see we don't have any regressions. Everything seems to work as expected.
- Rename SetEditorContextAction to EditorContextResult - Extend EditorContext with optional viewport and canvasBounds - Use EditorContext property in response instead of flat fields - Move GetSelectionHandler into SelectionService - Extract sendResponseToServer() hook in GLSPModelSource - Use IActionDispatcher instead of GLSPActionDispatcher in declare
Contributor
Author
|
@tortmayr Thank you! I updated the PR accordingly! |
tortmayr
reviewed
Apr 16, 2026
tortmayr
approved these changes
Apr 24, 2026
Contributor
tortmayr
left a comment
There was a problem hiding this comment.
Thanks, all review points are adressed.
The compatibility build with the server PR also succeeded:
https://github.com/eclipse-glsp/glsp-client/actions/runs/24898345067
LGTM! 👍🏼
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Enable symmetric request/response handling between client and server. Complements the server-side changes in glsp-server-node.
timeoutfield toRequestActionrequestUntil()default to respectaction.timeoutrequestUntil()so the receiving side can respect itrequest()vsrequestUntil()inhandleServerRequestandhandleClientRequestbased onaction.timeoutpresence&&vs||bug in requestId emptiness checksRequestActionimport to resolve GLSP protocol typehandleServerRequest()inGLSPModelSourcewithRejectActionerror handlingGetSelectionHandlerfor server-initiated selection queriesGetEditorContextAction/SetEditorContextActionprotocol types and handler inEditorContextServiceRelates to eclipse-glsp/glsp#607
How to test
Follow-ups
Changelog